<div class="list-box-function">
    <div class="page-guide">

        <?php if($nowpageid==1){?>
            <span>首页</span>
            <span>前一页</span>
        <?php }else{ ?>
            <a href="detail-list.php?sortby=<?php echo $sort_by; ?>&&sortorder=<?php echo $sort_order; ?>">首页</a>
            <a href="detail-list.php?nowpageid=<?php echo $prepage; ?>&&sortby=<?php echo $sort_by; ?>&&sortorder=<?php echo $sort_order; ?>">前一页</a>
        <?php } ?>
        <?php
        $ii = 1;
        $iii = 1;
        while ($ii <= $page_count) {
            if($ii==$nowpageid){
                echo "<span>".$ii."</span>";
            }else if((($ii+5)<$nowpageid)||(($ii-5)>$nowpageid)){}
            else{
                echo "<a href='";

                echo "detail-list.php?nowpageid=";
                echo $iii;
                echo "&&sortby=";
                echo $sort_by;
                echo "&&sortorder=";
                echo $sort_order;
                echo "'>";
                echo $iii;
                echo "</a>";
            }
            $ii++;
            $iii++;
        }
        ?>
        <?php
        if($nowpageid==$page_count){?>
            <span>后一页</span>
            <span>末页</span>
        <?php }else{ ?>
            <a href="detail-list.php?nowpageid=<?php echo $nextpage; ?>&&sortby=<?php echo $sort_by; ?>&&sortorder=<?php echo $sort_order; ?>">后一页</a>
            <a href="detail-list.php?nowpageid=<?php echo $lastpage; ?>&&sortby=<?php echo $sort_by; ?>&&sortorder=<?php echo $sort_order; ?>">末页</a>
        <? } ?>
    </div>
</div>